﻿@page "/privacyLibrary"
@namespace SwashbucklerDiary.Pages
@inherits DiariesPageComponentBase

<MAppBar App="true" Elevation="0">
    <MButton Icon="true"
             OnClick="NavigateToBack">
        <MIcon>
            mdi-arrow-left
        </MIcon>
    </MButton>

    <MySearch @bind-Value="ShowSearch"
    @bind-Search="Search"
              Title="@(I18n.T("Setting.Safe.PrivacyLibrary.Name"))"
              OnChanged="UpdateDiariesAsync">
    </MySearch>

    <MButton Icon="true"
             OnClick="()=>ShowSearch=!ShowSearch">
        <MIcon>
            mdi-magnify
        </MIcon>
    </MButton>

    <MButton Icon="true"
             OnClick="()=>ShowFilter=!ShowFilter">
        <MIcon>
            @(IsDateFiltered ? "mdi-filter-check-outline" : "mdi-filter-outline")
        </MIcon>
    </MButton>
</MAppBar>

<ScrollContainer>
    <DiaryCardList @bind-Tags="Tags"
                   Value="Diaries"
                   NotFoundText="@(IsSearchFiltered ? I18n.T("Search.Not Found"):null)" />
</ScrollContainer>

<DateFilterDialog @bind-Value="ShowFilter"
@bind-Form="SearchForm.DateFilter"
                  OnOK="UpdateDiariesAsync"
                  OnReset="UpdateDiariesAsync">
</DateFilterDialog>
